<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">

    <title>用户管理</title>

    <!-- Vendors Style-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/vendors_css.css">

    <!-- Style-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/style.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/skin_color.css">

</head>

<body class="hold-transition light-skin sidebar-mini theme-primary fixed">

<div class="container-full">
    <!-- Content Header (Page header) -->
    <div class="content-header">
        <div class="d-flex align-items-center">
            <div class="mr-auto">
                <h3 class="page-title">用户列表</h3>
                <div class="d-inline-block align-items-center">
                    <nav>
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item"><a href="#"><i class="mdi mdi-home-outline"></i></a></li>
                            <li class="breadcrumb-item active" aria-current="page">用户列表</li>
                        </ol>
                    </nav>
                </div>
            </div>
        </div>
    </div>

    <!-- Main content -->
    <section class="content">

        <div class="row">
            <div class="col-12">
                <div class="box">
                    <div class="box-header with-border">
                        <h4 class="box-title">
                            <button onclick="window.location.href='${pageContext.request.contextPath}/userAdd'" type="button" class="waves-effect waves-light btn btn-outline btn-primary mb-5 btn-sm">添加</button>
                        </h4>
                        <div class="box-controls pull-right">
                           <form action="${pageContext.request.contextPath}/userList" method="post">
                               <div class="row">
                                   <div class="col-md-8">
                                       <div class="form-group">
                                           <input name="key" type="text" class="form-control" placeholder="关键字" value="${key}">
                                       </div>
                                   </div>
                                   <div class="col-md-4">
                                       <div class="form-group">
                                           <button type="submit" class="waves-effect waves-light btn btn-outline btn-primary mb-5 btn-sm">查询</button>
                                       </div>
                                   </div>
                               </div>
                           </form>

                        </div>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body no-padding">
                        <div class="table-responsive">
                            <table class="table table-hover">
                                <tr>
                                    <th>编号</th>
                                    <th>姓名</th>
                                    <th>部门</th>
                                    <th>性别</th>
                                    <th>年龄</th>
                                    <th>操作</th>
                                </tr>
                                <c:forEach var="u" items="${list}">
                                    <tr>
                                        <td>${ u.userNo }</td>
                                        <td>${ u.userName }</td>
                                        <td><span class="text-muted">${ u.deptName }</span></td>
                                        <td>
                                            <c:if test="${u.sex == '0'}">男</c:if>
                                            <c:if test="${u.sex == '1'}">女</c:if>
                                        </td>
                                        <td>${ u.age }</td>
                                        <td>
                                            <button onclick="window.location.href='${pageContext.request.contextPath}/userEdit?id=${u.id}'" type="button" class="waves-effect waves-light btn btn-outline btn-primary btn-sm" style="margin-right: 10px">编辑</button>
                                            <button onclick="window.location.href='${pageContext.request.contextPath}/userDelete?id=${u.id}'" type="button" class="waves-effect waves-light btn btn-outline btn-primary btn-sm">删除</button>
                                        </td>
                                    </tr>
                                </c:forEach>

                            </table>
                        </div>
                    </div>
                    <!-- /.box-body -->
                    <c:import url="common/page.jsp">
                        <c:param name="currentPage" value="${page.currentPage}" />
                        <c:param name="pageSize" value="${page.pageSize}" />
                        <c:param name="totalCount" value="${page.totalCount}" />
                        <c:param name="totalPage" value="${page.totalPage}" />
                    </c:import>
                </div>
                <!-- /.box -->
            </div>
        </div>
        <!-- /.row -->

    </section>
    <!-- /.content -->
</div>


<!-- Vendor JS -->
<script src="${pageContext.request.contextPath}/static/js/vendors.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/chat-popup.js"></script>
<script src="${pageContext.request.contextPath}/static/js/feather.min.js"></script>

<script src="${pageContext.request.contextPath}/static/js/moment.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/fullcalendar.js"></script>

<!-- EduAdmin App -->
<script src="${pageContext.request.contextPath}/static/js/template.js"></script>

<script src="${pageContext.request.contextPath}/static/js/calendar.js"></script>

</body>
</html>

